export const formEmit: (keyof IFormE)[] = ["emitBeforeValidSubmit", "emitDownTemplate", "emitDeleteValue", "emitChangeProps", "emitHasChange", "emitBeforeSubmit", "emitBeforeUpload", "emitOtherGetFile"];
export class formData {
  emit;
  formPropsObj: IFormP = { formOpt: { items: {} } };
  constructor(props: IFormP, emit: (event: keyof IFormE, ...args: any[]) => void) {
    this.emit = emit;
    this.formPropsObj = props;
  }
  formEmitsObj: IFormE = {
    emitBeforeSubmit: ({ submitData, fn }) => {
      this.emit("emitBeforeSubmit", { submitData, fn });
    },
    emitHasChange: ({ e, key, item, form }) => {
      this.emit("emitHasChange", { e, key, item, form });
    },
    emitBeforeUpload: ({ file, type, item, fileProp }) => {
      this.emit("emitBeforeUpload", { file, type, item, fileProp });
    },
    emitOtherGetFile: ({ e, props }) => {
      this.emit("emitOtherGetFile", { e, props });
    },
    emitChangeProps: ({ e, propsName }) => {
      this.emit("emitChangeProps", { e, propsName });
    },
    emitDeleteValue: ({ key, indey, itey }) => {
      this.emit("emitDeleteValue", { key, indey, itey });
    },
    emitDownTemplate: ({ item }) => {
      this.emit("emitDownTemplate", { item });
    },
    emitBeforeValidSubmit: ({ submitData }) => {
      this.emit("emitBeforeValidSubmit", { submitData });
    }
  };
}
